package com.hdax.dm.common.utils;

import lombok.Getter;

@Getter
public class CommonResponse<T> {
    private String success;
    private String errorCode;
    private String msg;
    private T data;

    private static final String SUCCESS_CODE = "0000";

    private CommonResponse(){}

    //响应数据
    public CommonResponse(String errorCode,String msg){
        this.success = "success";
        this.errorCode = errorCode;
        this.msg = msg;
    }
    //成功响应数据2
    public CommonResponse( String errorCode,String msg,T data){
        this.success = "success";
        this.errorCode = errorCode;
        this.msg = msg;
        this.data = data;
    }
    //成功响应数据3
    public CommonResponse(T data){
        this.success = "success";
        this.errorCode = SUCCESS_CODE;
        this.msg = "success";
        this.data = data;
    }

}
